<link type="text/css" rel="stylesheet" href="css/ui/Calendar.css" media="screen" />
<link type="text/css" rel="stylesheet" href="css/productOrder.css" media="screen" />
<script src="http://www.12301.cc/js/popBox.js"></script>
<style>
    #contactList{margin-bottom:10px; background:#f3faff; padding:10px;}
    #contactList li{ float:left; margin-right:20px; width:80px; text-align:center}
    #contactList li input{vertical-align:-2px; margin-right:2px;}
    .oper{ cursor:pointer}
    #popBox{ text-align:left; border:8px solid #767576; padding:20px;}
    .close{cursor:pointer;position:absolute; right:20px;top:10px;text-align:center;  font-size:14px; font-weight:bold;}
    #popBox h3{ color:#265895;font-weight:bold}
    #popBox textarea{ width:300px; height:80px;}
    #popBox  input.btn{padding:5px 10px; margin-right:20px; cursor:pointer; font-size:12px; }
    span.note_name{color:red;}
</style>
<div class="clay">
<input type="hidden" id="remaindMoney" value="<?=$v['money']?>"/>
<input type="hidden" id="remainTmoney" value="<?=$v['tmoney']?>"/>
<input type="hidden" id="minbuytnum" value="<?=$p_info['buy_limit_low']?>"/>
<?if($p_info['buy_limit_up']>0){?>
<input type="hidden" id="remainnum" value="<?=$p_info['buy_limit_up']?>"/>
<?}?>
<input type="hidden" id="pay" value="<?=$p_info['pay']?>"/>
<input type="hidden" id="tourist_info" value="<?=$land_f_info['tourist_info']?>"/>
<?if($_GET['a']):?>
<form action="formSubmit_dt.php" method="post" name="group">
<?else:?>
<form action="formSubmit.php" method="post" name="group">
<?endif;?>
<input type="hidden" name="pid" id="pid" value="<?=$pid?>"/>
<input type="hidden" name="aid" id="aid" value="<?=$aid?>"/>
<h2>
    <a target="_blank" href="scenicDetail.html?lid=<?=$p_info['lid']?>&did=<?=$memberID?>"><?=$p_info['ltitle']?></a>
</h2>
<div class="proBd">
<div class="contactW ">
    <h3 class="title">
        <span class="title">预订信息</span>
    </h3>
    <div class="box">
        <div class="ticketlist">
            <?php if($p_info['p_type']=="C"):?>
            <?php $leavetime=date("Y-m-d",strtotime($begintime)+24*3600);?>
            <p class="roomType line">
                <span class="lTitle">房间类型：</span>
                <?=$p_info['ttitle']?>
            </p>
            <p class="rooms line">
                <span class="lTitle"><i class="red">*</i>预订间数：</span>
                <select id="roomNum" name="tnum">
                    <?php for($j=$buynum;$j<=20;$j++):?>
                    <option value="<?=$j?>"><?=$j?>间</option>
                    <?php endfor;?>
                </select>
            </p>
            <p class="playtime line">
                <span class="lTitle"><i class="red">*</i>入住日期：</span>
                <input type="text" name="begintime" id="begintime" class="inputText" value="<?=$begintime?>"/>
                <span class="lTitle"><i class="red">*</i>离店日期：</span>
                <input type="text" name="leavetime" id="leavetime" class="inputText" value="<?=$leavetime?>"/>
            </p>
            <ul class="priceItem">
				<li>
					<div class="title"> <?=substr($begintime,5)?>(<?=$date_format[date('N')]?>)</div>
					<input type="hidden" value="<?=$jsprice/100?>">
					<div class="priItem">
						<span>¥<?=$jsprice/100?></span><br>
						<span><?=$storage?></span>
						<input type="hidden" class="tnum" value="1">
					</div>
				</li>
			</ul>
            <?php else:?>
            <p class="playtime line">
                <?php if($p_info['p_type']=="A"||$p_info['p_type']=="B"||$p_info['p_type']=="F"||$p_info['p_type']=="G"):?>
                <span class="lTitle"><i class="red">*</i>游玩日期：</span>
                <input type="text" name="begintime" id="begintime" class="inputText" value="<?=$begintime?>"/>
                (<?=$timeTitle?>)&nbsp;&nbsp;<span style="color:red;"><?=$valid?></span>
                <?php elseif($p_info['p_type']=="D"):?>
                <input type="hidden" name="begintime" id="begintime" class="inputText"  value="<?=$begintime?>"/>
                <?php endif;?>
                <!--鼓浪屿轮渡信息-->
                <?php
                        if($_GET['pzp']){
                        ?>
                <span class="lTitle">出发时间：</span>
					<select name="cooperation_way" id="bindLista" class="selectcss">
						<?=$selectTxt?> 
					</select>
                <?}?>
            </p>
            <table id="tbTickets" class="listCon proTable type<?=$p_info['p_type']?>" style="width:100%;">
                <thead>
                <tr>
                    <th class="list_1">产品名称</th>
                    <th>产品库存</th>
                    <th class="price">门市价</th>
                    <th class="price">建议零售价</br><span class="s_note">(低于零售价将按协议处罚)</span></th>
                    <th class="price">结算价</th>
                    <th>预订数量</th>
                    <th>小计</th>
					<th>退票手续费</th>
                </tr>
                </thead>
                <tbody>
                <?php foreach($products as $row):?>
                <tr class="line <?=++$pn>3?"more display_none":""?>">
				<input type="hidden" class="order_start" value="<?=$row['order_start']?>" />
				<input type="hidden" class="order_end" value="<?=$row['order_start']?>" />
                <td class="list_1 list"><?=$row['ttitle']?></td>
                <td><em class="storage_<?=$row['pid']?>"><?=$row['storage'] ?></em></td>
                <td class="list_2 list"><em class="price">¥<?=$row['tprice']?></em></td>
                <td class="list_2 list" data-p="<?=$row['uprice']?>"><em class="price jprice uprice_<?=$row['pid']?>">¥<?=$row['uprice']/100?></em></td>
                <td class="list_3 list"><em class="price jprice tprice_<?=$row['pid']?>">¥<?=$row['jsprice']/100?></em></td>
                <td class="list_4 list">
                    <input type="hidden" class="tprice_<?=$row['pid']?>" value="<?=$row['jsprice']/100?>"/>
                    <div class="jiajian">
                        <a href="#" class="jian jjBtn J_jianBtn minus">减一张</a>
                        <input type="text" id="<?=$row['id']?>" name="<?=$row['name']?>" value="<?=$row['buynum']?>" p_minTime="<?=$row['minTime']?>" p_minbuy="<?=$row['buy_limit_low']?>" class="input_text tnum">
                        <a href="#" class="jia jjBtn J_jiaBtn add">加一张</a>
                    </div>
                </td>
                <td class="list_6 list totalprice">¥<em class="subtotal">
				<?php 
				if($row['buynum']*$row['jsprice']/100==0){
				echo "0.0";
				}else{
				echo $row['buynum']*$row['jsprice']/100;
				}
				?>
				<!--<?=$row['buynum']*$row['jsprice']/100?>-->
				</em></td>
				<td>
                    <?=$row['reb_type']==1?'固定费用':'百分比'?>
                    <?=$row['reb_type']==1?$row['reb']/100:$row['reb'].'%'?>
                </td>
                </tr>
            <?php endforeach;?>
                </tbody>
            </table>
    <?php if(count($products)>3):?>
    <p class="addTicket">
                <a class="fr show_more">显示所有门票类型</a>
            </p>
    <?php endif;?>
    <?php endif;?>
        </div>
        <div class="clear"></div>
    <?php if($ass_station=unserialize($land_f_info['ass_station'])):?>
    <p class="line">
            <span class="lTitle"><i class="red">*</i>集合地址：</span>
            <select name="assembly">
                <?php foreach($ass_station as $key=>$station):?>
                <option value="<?=$key?>"><?=$station?></option>
                <?php endforeach;?>
            </select>
        </p>
    <?php endif;?>
    </div>
</div>
        <!--管理常用联系人-->
<textarea id="pop_tpl" style="display:none">
<div id="popBox">
	<a class="close" onclick="popBox.close()">X</a>
	<h3>常用联系人管理</h3>
	<form  id="form1" action="../cutinfo.php" method="post" name="haha">
        <div id="contactList">
            <ul>
			   
                <?php foreach($cinfos as $cname=>$cmobile):?>
                <li>
                    <input id="testInput" type="checkbox" name="cutname[]" value="<?=$cname?>">
                    <span class="name"><?=$cname?></span>	
                </li>
                <?php endforeach;?>
				
            </ul>
            <p class="cl"></p>
        </div>
      <input  type="submit" id="Submit" value="删 除"/>
	</form>
 </div>
</textarea>
        <!--管理常用联系人结束-->





<div id="RecommendProducts" class="contactW"></div>
<div class="contactW ">
    <h3 class="title">
        <span class="title">联系人信息</span>（请准确填写联系人信息，我们将向联系人手机发送订单短信）
        <span class="save"><input type="checkbox" checked value="1" name="saveTo" class="inputText"/>保存到常用联系人</span>
		<a class="oper" orderid="" inputV="">操作</a>
    </h3>
    <div class="box">
        <?php if(count($cinfos)>0):?>
        <div id="contactList">
            <ul>
                <?php foreach($cinfos as $cname=>$cmobile):?>
                <li>
                    <input type="checkbox" value="<?=$cmobile?>">
                    <span class="name"><?=$cname?></span>
                </li>
                <?php endforeach;?>
            </ul>
            <p class="cl"></p>
        </div>
        <?php endif;?>
        <p class="line">
            <span class="lTitle"><i class="red">*</i>联系人：</span>
            <input type="text" class="inputText" id="ordername" autocomplete="off" name="ordername"/>
			<span class="note_name"></span>
		</p>
        <?if($_GET['pzp']){?>
        <p class="line">
				<span class="lTitle"><i class="red">*</i>身份证：</span>
				<input type="text" style="width:400px"  class="inputText" id="IDnum" name="IDnum">
			</p>
        <?}?>
        <p class="line">
            <span class="lTitle"><i class="red">*</i>手机号码：</span>
            <input type="text"  class="inputText" id="ordertel" name="ordertel">
            (接收订单短信，请务必正确填写)
        </p>
        <p class="line">
            <span class="lTitle">备注信息：</span>
            <input type="text" style="width:400px"  class="inputText" id="memo" name="memo">
        </p>
        <?if($m_info['cname']&&$m_info['ctel']){
                $cname=explode("|",$m_info['cname']);
                $ctel=explode("|",$m_info['ctel']);
                ?>
        <div class="contactWrap" id="contactWrap">
            <div class="content">
                <a class="closebtn"></a>
                <h4>您可以选择以下常用联系人：</h4>
                <ul>
                    <?for($i=count($cname)-1;$i>=0;$i--){
                            if(!$cname[$i]) continue;
                            ?>
                    <li>
                        <input type="checkbox" value="<?=$ctel[$i]?>" />
                        <span class="name"><?=$cname[$i]?></span>
                    </li>
                    <?}?>
                </ul>
                <p class="clear">&nbsp;</p>
            </div>
        </div>
        <?}?>
    </div>
</div>
<div class="">
    <h3 class="title"><span class="title">供应商信息</span></h3>
    <div class="box orderinfo">
        <p>
            <span>供应商名称：<?=$a_info['dname']?></span>
            <?php if($a_info['qq']):?>
            <span>QQ：<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=<?=$a_info['qq']?>&site=qq&menu=yes"><img onerror="this.parentNode.removeChild(this)" style="vertical-align:-5px" border="0" src="http://wpa.qq.com/pa?p=2:<?=$a_info['qq']?>:52" alt="点击这里给我发消息" title="点击这里给我发消息"/></a></span>
            <?php endif;?>
            <span>联系人：<?=$a_info['cname']?> <?=$a_info['mobile']?></span>
        </p>
    </div>
</div>
        <?php if($land_f_info['p_type']=='C'):?>
<div class="guest">
    <h3 class="title"><span class="title">入住信息</span></h3>
    <div class="box roomInfo">
        <?php if($land_f_info['tourist_info']>0):?>
        <p class="line">
            <span class="lTitle"><i class="red">*</i>入住人姓名：</span>
							<span class="roomDiv">
								<input type="text" class="inputText roomer gray" id="roomer" name="tourist_name_1" value="入住人1"/>
								<span class="ts">(请填写实际入住人姓名，每个房间只需填1位)</span>
							</span>
        </p>
        <?php endif;?>
        <div class="clear"></div>
        <p class="arriveTime line">
            <span class="lTitle"><i class="red">*</i>最晚到店：</span>
            <select class="" name="arriveTime" id="arriveTime">
                <option value="">请选择时间</option>
                <option>15:00</option>
                <option>16:00</option>
                <option>17:00</option>
                <option>18:00</option>
                <option>19:00</option>
                <option>20:00</option>
                <option>21:00</option>
                <option>22:00</option>
                <option>23:00</option>
                <option>24:00</option>
                <option>次日1:00</option>
                <option>次日2:00</option>
                <option>次日3:00</option>
                <option>次日4:00</option>
                <option>次日5:00</option>
            </select>
        </p>
    </div>
</div>
        <?php elseif($land_f_info['tourist_info']>0):?>
<div class="contactW ">
    <h3 class="title"><span class="title">旅客信息</span>（儿童证件号码请填写出生日期）</h3>
    <div class="box tourist">
        <?php if($land_f_info['tourist_info']==1):?>
        <div class="info">
            <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
							<span>
								<select class="tourist_type" style="display:none">
                                    <option value="1">成人</option>
                                </select>
							</span>
							<span>
								<label class="lt"><i class="red">*</i>姓名:</label>
								<input type="text" name="tourist_name_1" class="tourist_name">
							</span>
							<span>
								<label class="lt"><i class="red">*</i>身份证号:</label>
								<input type="text" name="tourist_cert_1" class="tourist_cert" >
							</span>
        </div>
        <?php else:?>
        <?php for($i=1;$i<=$buynum;$i++):?>
        <div class="info">
            <span>第<?=$i?>位游客</span>
                                <span>
                                    <select class="tourist_type">
                                        <option value="1">成人</option>
                                        <option value="0">儿童</option>
                                    </select>
                                </span>
                                <span>
                                    <label class="lt"><i class="red">*</i>姓名:</label>
                                    <input type="text" name="tourist_name_<?=$i?>" class="tourist_name">
                                </span>
                                <span>
                                    <label class="lt"><i class="red">*</i>身份证号:</label>
                                    <input type="text" name="tourist_cert_<?=$i?>" class="tourist_cert" >
                                </span>
        </div>
        <?php endfor;?>
        <?php endif?>
    </div>
</div>
        <?php endif;?>
<div class="contactW ">
    <h3 class="title"><span class="title">支付方式</span></h3>
    <div class="box">
        <?php if($p_info['apply_did']==$memberID):?>
        <p style="padding-left:20px;">预订自供产品，无需支付</p>
        <input type="hidden" value="3" name="paymode"/>
        <?php elseif ($payMethod==0):?>
        <p style="padding-left:20px;">现场支付</p>
        <input type="hidden" value="4" name="paymode" />
        <?php else:?>
        <p class="line pmodel" style="padding-left:20px;">
            <input class="paymode" type="radio" name="paymode" <?=$paymodeCheck2?> value="2" >
            <span class="credit">授信余额<label> (可用<em class="money">¥<?=$v['tmoney']/100?></em>)</label></span>
            </br>
        <?if(!$access['yd']):?>
        <input class="paymode" type="radio" value="0" <?=$paymodeCheck0?> name="paymode">
            <span>账户余额<label> (可用<em class="money">¥<?=$v['money']/100?></em>)</label></span>
            </br>
    <?endif;?>
    <input class="paymode" type="radio" value="1" <?=$paymodeCheck1?> name="paymode">
            <span>在线支付</span>
        </p>
        <?php endif;?>
        </div>
        </div>

        </div>
<div class="totalCount">
    <p class="con">
        <a href="#" class="submitBtn"></a>
        <i class="icon"></i>
        <?php if($p_info['p_type']!="C"):?>
        <span class="span1">门票数：<em id="sumtnum" class="num"><?=$buynum?></em>张</span>
        <?php endif;?>
        <span class="span2">总金额：<em id="summoney" class="num"><?=$buynum*$jsprice/100?></em>元</span>
    </p>
</div>
<div class="about">
    <h3 class="title"><span class="title">预订须知</span></h3>
    <div class="content">
        <h3>购票需知：</h3>
        <?=nl2br($p_info['jqts'])?>
        <h3>产品说明：</h3>
        <?=$tips?>
        <h3>取票信息：</h3>
        <?=$p_info['getaddr']?>
    </div>
</div>
        </form>
        </div>
        </div>
<script type="text/html" id="tourist_tmpl">
    <div class="info">
        <span>第{:num}位游客</span>
		<span>
			<select class="tourist_type">
                <option value="1">成人</option>
                <option value="0">儿童</option>
            </select>
		</span>
		<span>
			<label class="lt"><i class="red">*</i>姓名:</label>
			<input type="text" name="tourist_name_{:num}" class="tourist_name">
		</span>
		<span>
			<label class="lt"><i class="red">*</i>身份证号:</label>
			<input type="text" name="tourist_cert_{:num}" class="tourist_cert" >
		</span>
    </div>
</script>
<script type="text/html" id="pri_tmpl">
    <li>
        <div class='title'> {:date}({:weekT})</div>
        <input type="hidden" value="{:jsprice}"/>
        <div class="priItem">
            <span>¥{:jsprice}</span></br>
            <span>{:roomStatus}</span>
            <input type="hidden" class="tnum" value="{:tnum}"/>
        </div>
    </li>
</script>
<script type="text/html" id="roomer_tmpl">
    <input type="text" class="inputText roomer more gray" name="tourist_name_{:i}" value="入住人{:i}"/>
</script>
<script type="text/javascript" src="js/jquery.getareas.js" type="text/javascript"></script>
<script type="text/javascript" src="js/global/Date_func.js"></script>
<script type="text/javascript" src="js/ui/JsTpl.js"></script>
<script type="text/javascript" src="js/ui/PopWindow.js"></script>
<script type="text/javascript" src="js/form/Verify.js"></script>
        <?php if($p_info['p_type']=="C"):?>
<script type="text/javascript" src="js/ui/Calendar_hotel.js"></script>
        <?php else:?>
<script type="text/javascript" src="js/ui/Calendar.js"></script>
        <?php endif;?>
<script type="text/javascript" src="js/productOrder.js"></script>

        <?php if($p_info['p_type']=='F'):?>
<script>
    <? include '/var/www/html/new/d/module/link_product/child_tickets.js';?>
</script>
        <?php else:?>
<script>
    <? include '/var/www/html/new/d/module/link_product/link_product.js';?>
</script>
        <?php endif;?>


<script>
var popBox=new PopWindow();
var oper=function(elem,tag){
    var textarea=$(elem).parent().find("textarea");
    if(tag==1){
        $("#popBox .Ddstatus").val("1");
        $("#popBox form").submit();
    }else{
        $("#popBox .Ddstatus").val("2");
        $("#popBox form").submit();
    }
}
$("a.denybtn").click(function(){
    var applyid=$(this).attr("applyid");
    $("#applyid").val(applyid);
    popBox.open($("#pop_tpl").html())
    return false;
})

$("a.oper").click(function(){
    popBox.open($("#pop_tpl").text());
    return false;
});



// var verify = {
// is_chinese : function(str) {
// // var  reg_zh = /[\u4E00-\u9FA5\uF900-\uFA2D]/;
// var  reg_zh = /[`~!@#\$%\^\&\*\(\)_\+<>\?:"\{\},\.\\\/;'\[\]]/im;
// return reg_zh.test(str);
// },
// is_email : function(email){
// if(email.length>6) {
// var emailReg = /^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/;
// var re = new RegExp(emailReg);
// return re.test(email);
// }
// return false;
// },
// isTel:function(val){
// //var reg =  /^0?1[3|4|5|8][0-9]\d{8}$/;
// var reg =  /[`~!@#\$%\^\&\*\(\)_\+<>\?:"\{\},\.\\\/;'\[\]]/im;
// return reg.test(val) ? '1':'';
// }
// }
// $("input[name=ordername]").on('keyup', function(){
// // //alert('sss');
// if(verify.isTel($(this).val())){
// line.find("span.note_name").html('抱歉联系人包含特殊字符').hide();
// return false;
// }else if(verify.is_chinese($(this).val())){
// line.find("span.note_name").html('抱歉联系人包含特殊字符').hide();
// }else{
// line = $(this).parents("div").find('div.box');
// line.find("span.note_name").html('抱歉联系人包含特殊字符').show();
// line.show();
// }
// });

// $("input[name=ordername]").on('focus', function(){
// if(!verify.is_chinese($(this).val()) && !verify.isTel($(this).val())){
// line = $(this).parents("div").find('div.box');
// line.find("span.note_name").html('抱歉联系人包含特殊字符').show();
// line.show();
// }

// });

</script>
